﻿namespace _1.Maping_all_tables_in_DB_First
{
	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;
	using System.Threading.Tasks;

	class Main_Task1
	{
		static void Main()
		{
			var databaseContext = new SoftUniEntities();
			var employeeAddresses = databaseContext.Employees
				.Where(emp => emp.FirstName == "John")
				.OrderBy(emp => emp.Address.AddressText)
				.Select(emp => emp.Address.AddressText) // 'Select' must be the last query
				.ToList();

			employeeAddresses.ForEach(Console.WriteLine);
		}
	}
}